.class public final Lcom/adwhirl/a/d;
.super Lcom/adwhirl/a/c;
.source "CustomAdapter.java"


# direct methods
.method public constructor <init>(Lcom/adwhirl/AdWhirlLayout;Lcom/adwhirl/b/c;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 44
    invoke-direct {p0, p1, p2}, Lcom/adwhirl/a/c;-><init>(Lcom/adwhirl/AdWhirlLayout;Lcom/adwhirl/b/c;)V

    .line 45
    return-void
.end method


# virtual methods
.method public final a()V
    .locals 5

    .prologue
    .line 49
    iget-object v0, p0, Lcom/adwhirl/a/d;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adwhirl/AdWhirlLayout;

    .line 50
    if-nez v0, :cond_0

    .line 55
    :goto_0
    return-void

    .line 54
    :cond_0
    iget-object v0, v0, Lcom/adwhirl/AdWhirlLayout;->c:Ljava/util/concurrent/ScheduledExecutorService;

    new-instance v1, Lcom/adwhirl/a/f;

    invoke-direct {v1, p0}, Lcom/adwhirl/a/f;-><init>(Lcom/adwhirl/a/d;)V

    const-wide/16 v2, 0x0

    sget-object v4, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-interface {v0, v1, v2, v3, v4}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;

    goto :goto_0
.end method

.method public final b()V
    .locals 14

    .prologue
    const/16 v13, 0xf

    const/4 v12, 0x1

    const/high16 v11, 0x4218

    const/4 v10, 0x0

    const/4 v9, -0x1

    .line 58
    iget-object v0, p0, Lcom/adwhirl/a/d;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adwhirl/AdWhirlLayout;

    .line 59
    if-nez v0, :cond_1

    .line 157
    :cond_0
    :goto_0
    return-void

    .line 63
    :cond_1
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/app/Activity;

    .line 64
    if-eqz v1, :cond_0

    .line 68
    iget-object v2, v0, Lcom/adwhirl/AdWhirlLayout;->e:Lcom/adwhirl/b/a;

    iget v2, v2, Lcom/adwhirl/b/a;->a:I

    packed-switch v2, :pswitch_data_0

    .line 151
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->a()V

    goto :goto_0

    .line 72
    :pswitch_0
    new-instance v2, Landroid/widget/RelativeLayout;

    invoke-direct {v2, v1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    .line 73
    iget-object v3, v0, Lcom/adwhirl/AdWhirlLayout;->e:Lcom/adwhirl/b/a;

    iget-object v3, v3, Lcom/adwhirl/b/a;->c:Landroid/graphics/drawable/Drawable;

    if-nez v3, :cond_2

    .line 74
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->a()V

    goto :goto_0

    .line 77
    :cond_2
    new-instance v3, Landroid/widget/ImageView;

    invoke-direct {v3, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 78
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->e:Lcom/adwhirl/b/a;

    iget-object v1, v1, Lcom/adwhirl/b/a;->c:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 79
    sget-object v1, Landroid/widget/ImageView$ScaleType;->FIT_CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v3, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 80
    new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v1, v9, v9}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 81
    invoke-virtual {v2, v3, v1}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 82
    invoke-virtual {v0, v2}, Lcom/adwhirl/AdWhirlLayout;->a(Landroid/view/ViewGroup;)V

    .line 155
    :goto_1
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->j:Lcom/adwhirl/g;

    invoke-virtual {v1}, Lcom/adwhirl/g;->d()V

    .line 156
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->b()V

    goto :goto_0

    .line 87
    :pswitch_1
    new-instance v2, Landroid/widget/RelativeLayout;

    invoke-direct {v2, v1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    .line 88
    iget-object v3, v0, Lcom/adwhirl/AdWhirlLayout;->e:Lcom/adwhirl/b/a;

    iget-object v3, v3, Lcom/adwhirl/b/a;->c:Landroid/graphics/drawable/Drawable;

    if-nez v3, :cond_3

    .line 89
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->a()V

    goto :goto_0

    .line 94
    :cond_3
    new-instance v3, Landroid/widget/FrameLayout$LayoutParams;

    const/high16 v4, 0x43a0

    invoke-static {v4}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v4

    float-to-int v4, v4

    const/high16 v5, 0x4248

    invoke-static {v5}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v5

    float-to-int v5, v5

    invoke-direct {v3, v4, v5}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v2, v3}, Landroid/widget/RelativeLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 95
    new-instance v3, Landroid/widget/ImageView;

    invoke-direct {v3, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 96
    iget-object v4, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    iget v4, v4, Lcom/adwhirl/b/b;->e:I

    iget-object v5, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    iget v5, v5, Lcom/adwhirl/b/b;->f:I

    iget-object v6, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    iget v6, v6, Lcom/adwhirl/b/b;->g:I

    invoke-static {v4, v5, v6}, Landroid/graphics/Color;->rgb(III)I

    move-result v4

    .line 99
    new-instance v5, Landroid/graphics/drawable/GradientDrawable;

    sget-object v6, Landroid/graphics/drawable/GradientDrawable$Orientation;->TOP_BOTTOM:Landroid/graphics/drawable/GradientDrawable$Orientation;

    const/4 v7, 0x4

    new-array v7, v7, [I

    const v8, -0xcfcfd0

    aput v8, v7, v10

    aput v4, v7, v12

    const/4 v8, 0x2

    aput v4, v7, v8

    const/4 v4, 0x3

    const v8, -0xcfcfd0

    aput v8, v7, v4

    invoke-direct {v5, v6, v7}, Landroid/graphics/drawable/GradientDrawable;-><init>(Landroid/graphics/drawable/GradientDrawable$Orientation;[I)V

    .line 100
    invoke-virtual {v3, v5}, Landroid/widget/ImageView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 101
    new-instance v4, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v4, v9, v9}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 102
    invoke-virtual {v2, v3, v4}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 103
    new-instance v3, Landroid/widget/ImageView;

    invoke-direct {v3, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 104
    iget-object v4, v0, Lcom/adwhirl/AdWhirlLayout;->e:Lcom/adwhirl/b/a;

    iget-object v4, v4, Lcom/adwhirl/b/a;->c:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3, v4}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 105
    const/16 v4, 0xa

    invoke-virtual {v3, v4}, Landroid/widget/ImageView;->setId(I)V

    .line 109
    const/high16 v4, 0x4080

    invoke-static {v4}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v4

    float-to-int v4, v4

    const/high16 v5, 0x40c0

    invoke-static {v5}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v5

    float-to-int v5, v5

    invoke-virtual {v3, v4, v10, v5, v10}, Landroid/widget/ImageView;->setPadding(IIII)V

    .line 110
    sget-object v4, Landroid/widget/ImageView$ScaleType;->FIT_CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v3, v4}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 112
    new-instance v4, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-static {v11}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v5

    float-to-int v5, v5

    invoke-static {v11}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v6

    float-to-int v6, v6

    invoke-direct {v4, v5, v6}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 114
    invoke-virtual {v4, v13}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 115
    const/16 v5, 0x9

    invoke-virtual {v4, v5}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 117
    invoke-virtual {v2, v3, v4}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 118
    new-instance v4, Landroid/widget/ImageView;

    invoke-direct {v4, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 119
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v5

    const-string v6, "/com/adwhirl/assets/ad_frame.gif"

    invoke-virtual {v5, v6}, Ljava/lang/Class;->getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v5

    .line 120
    new-instance v6, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v6, v5}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Ljava/io/InputStream;)V

    .line 121
    invoke-virtual {v4, v6}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 125
    const/high16 v5, 0x4080

    invoke-static {v5}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v5

    float-to-int v5, v5

    const/high16 v6, 0x40c0

    invoke-static {v6}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v6

    float-to-int v6, v6

    invoke-virtual {v4, v5, v10, v6, v10}, Landroid/widget/ImageView;->setPadding(IIII)V

    .line 126
    sget-object v5, Landroid/widget/ImageView$ScaleType;->FIT_CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 128
    new-instance v5, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-static {v11}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v6

    float-to-int v6, v6

    invoke-static {v11}, Lcom/a0soft/gphone/a/a;->a(F)F

    move-result v7

    float-to-int v7, v7

    invoke-direct {v5, v6, v7}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 130
    invoke-virtual {v5, v13}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 131
    const/16 v6, 0x9

    invoke-virtual {v5, v6}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 133
    invoke-virtual {v2, v4, v5}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 134
    new-instance v4, Landroid/widget/TextView;

    invoke-direct {v4, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    .line 135
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->e:Lcom/adwhirl/b/a;

    iget-object v1, v1, Lcom/adwhirl/b/a;->e:Ljava/lang/String;

    invoke-virtual {v4, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 136
    sget-object v1, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;

    invoke-virtual {v4, v1, v12}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;I)V

    .line 137
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    iget v1, v1, Lcom/adwhirl/b/b;->a:I

    iget-object v5, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    iget v5, v5, Lcom/adwhirl/b/b;->b:I

    iget-object v6, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    iget v6, v6, Lcom/adwhirl/b/b;->c:I

    invoke-static {v1, v5, v6}, Landroid/graphics/Color;->rgb(III)I

    move-result v1

    invoke-virtual {v4, v1}, Landroid/widget/TextView;->setTextColor(I)V

    .line 138
    new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v1, v9, v9}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    .line 139
    invoke-virtual {v3}, Landroid/widget/ImageView;->getId()I

    move-result v3

    invoke-virtual {v1, v12, v3}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V

    .line 140
    const/16 v3, 0xa

    invoke-virtual {v1, v3}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 141
    const/16 v3, 0xc

    invoke-virtual {v1, v3}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 142
    invoke-virtual {v1, v13}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 143
    const/16 v3, 0xd

    invoke-virtual {v1, v3}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 144
    const/16 v3, 0x10

    invoke-virtual {v4, v3}, Landroid/widget/TextView;->setGravity(I)V

    .line 145
    invoke-virtual {v2, v4, v1}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 146
    invoke-virtual {v0, v2}, Lcom/adwhirl/AdWhirlLayout;->a(Landroid/view/ViewGroup;)V

    goto/16 :goto_1

    .line 68
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
